package com.codejiwei.core.rdd

import org.apache.spark.{SparkConf, SparkContext}

object Spark_Operator_Map {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local[1]").setAppName("Map")
    val sc = new SparkContext(conf)
    val rdd = sc.makeRDD(List(1, 2, 3, 4, 5))
    rdd.map{
      item => item * 2
    }.collect()
      .foreach(println)

    sc.stop()
  }
}
